/* Created By Micha Sherman, google workshop 2012
 * 
 */

package com.sporteamws;

import android.app.Activity;
import android.os.Bundle;
import android.widget.ArrayAdapter;
import android.widget.TabHost.TabSpec;
import android.widget.ListView;
import android.widget.TabHost;

public class Activities extends Activity
{
	ListView listView;
	
	@Override
	protected void onCreate(Bundle savedInstanceState)
	{
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activities);
		
	    //setup all tab host attributes
	    setupTabHost();
	   
	    //setup variables
	    setupVariables();
	    
	    
		listView = (ListView) findViewById(R.id.mylist);
		String[] values = new String[] { "User1", "User2", "User3",
			"User4", "User5", "User6", "User7", "User8",
			"User9", "User10" };

		// First parameter - Context
		// Second parameter - Layout for the row
		// Third parameter - ID of the View to which the data is written
		// Forth - the Array of data
		final ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,
			android.R.layout.simple_list_item_1, android.R.id.text1, values);

		// Assign adapter to ListView
		listView.setAdapter(adapter);
		
	}
	
	void setupVariables()
	{
       
	}
	
	void setupTabHost()
	{
		TabHost OptionTabHost = (TabHost) findViewById(R.id.Acttabhost);
	    OptionTabHost.setup();
	    
	    TabSpec specs = OptionTabHost.newTabSpec("tagUsers");
	    specs.setContent(R.id.tab1);
	    specs.setIndicator("Users");
	    OptionTabHost.addTab(specs);
	    
	    specs = OptionTabHost.newTabSpec("tagActvities");
	    specs.setContent(R.id.tab2);
	    specs.setIndicator("Activities");
	    OptionTabHost.addTab(specs);
	    
	}
	
	
	
	
	
}
